/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * index.java
 *
 * Created on 21-jul-2010, 10.00.00
 */

package mymall.views;
import java.awt.*; //modello eventi

/**
 *
 * @author Fabio Franchi
 */
public class index extends javax.swing.JFrame {
    private CardLayout cardLayout;
    //Variabili per l'inserimento di una nuova offerta
    private String titles , description , from , to ;
   
    /** Creates new form index */
    public index() {

        initComponents();

        pagePanel.setLayout(cardLayout);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cardLayout = new CardLayout();
        pagePanel = new javax.swing.JPanel(cardLayout);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("MyMall v1.0");
        setResizable(false);

        pagePanel.add(new mymall.views.home(this),"home");
        pagePanel.add(new mymall.views.info(this),"info");
        pagePanel.add(new mymall.views.infoposition(this),"infoposition");
        pagePanel.add(new mymall.views.infocentro(this),"infocentro");
        pagePanel.add(new mymall.views.infocentrotime(this),"infocentrotime");
        pagePanel.add(new mymall.views.infocentrocontact(this),"infocentrocontact");
        pagePanel.add(new mymall.views.infocentrocarinfo(this),"infocentrocarinfo");
        pagePanel.add(new mymall.views.infonegozi(this),"infonegozi");
        pagePanel.add(new mymall.views.infooffer(this),"infooffer");
        pagePanel.add(new mymall.views.eventi(this),"eventi");
        pagePanel.add(new mymall.views.eventi_2(this),"eventi_2");
        pagePanel.add(new mymall.views.eventi_3(this),"eventi_3");
        pagePanel.add(new mymall.views.posizione(this),"posizione");
        pagePanel.add(new mymall.views.programma(this),"programma");
        pagePanel.add(new mymall.views.areariservata(this),"areariservata");
        pagePanel.add(new mymall.views.areariservata_descrizione(this),"areariservata_descrizione");
        pagePanel.add(new mymall.views.areariservata_periodo(this),"areariservata_periodo");
        //pagePanel.add(new mymall.views.areariservata_fine(this),"areariservata_fine");
        pagePanel.setBackground(new java.awt.Color(255, 255, 255));
        pagePanel.setForeground(new java.awt.Color(255, 255, 255));
        pagePanel.setPreferredSize(new java.awt.Dimension(1024, 768));
        pagePanel.setLayout(new java.awt.CardLayout());

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new index().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel pagePanel;
    // End of variables declaration//GEN-END:variables

    public void activeView(String p) {
        if(p == "areariservata_fine"){
            pagePanel.add(new mymall.views.areariservata_fine(this),"areariservata_fine");
        }
        cardLayout.show(pagePanel, p);
        cardLayout.getClass();
    }

   public void setTitles(String tit){
       this.titles = tit;
   }

   public void setDescription(String des){
       this.description = des;
   }

   public void setFrom(String da){
       this.from = da;
   }

   public void setTo(String a){
       this.to = a;
   }

   public String getTitles(){
       return this.titles;
   }

   public String getDescription(){
       return this.description;
   }

   public String getFrom(){
       return this.from;
   }

   public String getTo(){
       return this.to;
   }

}

